home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 1068 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: "Nathan Myers <ncm@cantrip.org>" <ncm@cantrip.org>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: char_traits<T> return values
  5. Date: 13 Apr 1996 23:17:19 GMT
  6. Organization: Best Internet Communications
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <316F5716.53ABC674@cantrip.org>
  9. References: <316DB8A8.2556@cyberspy.com>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Mime-Version: 1.0
  12. Content-Type: text/plain; charset=us-ascii
  13. Content-Transfer-Encoding: 7bit
  14. X-Nntp-Posting-Host: ncm.vip.best.com
  15. X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i386)
  16. Content-Length: 606
  17. Originator: clamage@taumet
  18.  
  19. Rich Paul wrote:
  20. > I have noticed, while working on the standard string class, that the
  21. > char_traits functions ...
  22. > ... when these functions get a string that contains eos(), do they
  23. > stop, or do they carry on to the bitter end?
  24.  
  25. C++ strings don't pass judgment on what's in them; eos() is used
  26. purely as the value to slap onto the end when producing a c_str() 
  27. value, or the terminator when constructing from a const char*.
  28.  
  29. It only matters when you convert back via c_str(); then, of course,
  30. to C the string will look shorter than it is.  Tough.
  31.  
  32. Nathan Myers
  33. ncm@cantrip.org  http://www.cantrip.org/
  34.  
  35.  
  36. [ comp.std.c++ is moderated.  To submit articles: try just posting with      ]
  37. [ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu         ]
  38. [ FAQ:      http://reality.sgi.com/employees/austern_mti/std-c++/faq.html    ]
  39. [ Policy:   http://reality.sgi.com/employees/austern_mti/std-c++/policy.html ]
  40. [ Comments? mailto:std-c++-request@ncar.ucar.edu                             ]
  41.